{if $content.item == 'show'}
{if $content.content}
	<b>{$content.content.title}</b>&nbsp;&nbsp;{$smarty.const.LANG_POSTED_BY}&nbsp;{$content.content.user}&nbsp;&nbsp;{$smarty.const.LANG_AT}&nbsp;{$content.content.time}
	{if $content.content.can_edit}
	&nbsp;&nbsp;[<a href="{$webdir}?page={$page}&news_task=edit&news_id={$content.content.id}">{$smarty.const.LANG_EDIT_NEWS}</a>]
	&nbsp;&nbsp;[<a href="{$webdir}?page={$page}&news_task=remove&news_id={$content.content.id}">{$smarty.const.LANG_REMOVE_NEWS}</a>]
	{/if}
	<br />
	{$content.content.content}<br />
	{$content.content.add_content}
	{if $need_comment_confirm}
	<br /><br /><a href="{$webdir}?page={$page}&news_task=confirm_comment&news_id={$content.content.id}">{$need_comment_confirm} {$smarty.const.LANG_NEED_COMMENT_CONFIRM}</a>
	{/if}
	<br />
	{if $comment_sended === true}
		{if $comment_confirmed}
		{$smarty.const.LANG_COMMENT_CONFIRMED}<br />
		{else}
		{$smarty.const.LANG_COMMENT_SEND}<br />
		{/if}
	{elseif $comment_sended === false}
		{$smarty.const.LANG_COMMENT_SEND_ERROR}<br />
	{/if}
	{if $comments}
	<br />{$smarty.const.LANG_COMMENTS}:<br />
	<hr />
	{foreach from=$comments item=comment}
	{$comment.who_comment}: <b>{$comment.title}</b>
	{if $can_remove_comment}&nbsp;
	[<a href="{$webdir}?page={$page}&news_task=remove_comment&news_id={$content.content.id}&comment_id={$comment.id}">{$smarty.const.LANG_REMOVE_COMMENT}</a>]
	{/if}
	<br />
	{$comment.content}<hr />
	{/foreach}
	{/if}
	{if $can_comment}
	<br /><br />{$smarty.const.LANG_SEND_COMMENT}:<br />
	<form action="" method="post">
	{if !$is_user}{$smarty.const.LANG_NAME}: <input type="text" name="cm_name" /><br />{/if}
	{$smarty.const.LANG_TITLE}:<input type="text" name="cm_title" /><br />
	{$smarty.const.LANG_COMMENT}:<br /><textarea name="cm_content"></textarea><br />
	<input type="submit" name="cm_submit" value="{$smarty.const.LANG_SUBMIT}" />
	</form>
	{/if}
{else}
	{$smarty.const.LANG_NO_NEWS}
{/if}
<br />
<a href="{$webdir}?page={$page}">{$smarty.const.LANG_BACK}</a>

{elseif $content.item == 'add'}
	<br />
{if $can_send}
	{if $content.content > 0}
		<ul>
		{if $confirmed}
		<li><a href="{$webdir}?page={$page}&news_task=show&news_id={$content.content}">{$smarty.const.LANG_ADDED_NEWS}</a>.</li>
		{else}
		<li>{$smarty.const.LANG_ADDED_NEWS}</li>
		<li>{$smarty.const.LANG_ADDED_NEWS_NEED_CONFIRM}</li>
		{/if}
		</ul>
	{elseif $content.content === false}
		<ul><li class="lb_errormenu">{$smarty.const.LANG_ADD_NEWS_ERROR}</li></ul>
	{else}
	<form action="{$webdir}?page={$page}&news_task=add" method="post">
	<table align="center">
		<tr><td>{$smarty.const.LANG_TITLE}</td><td><input type="text" name="title" size="60" /></td></tr>
		<tr><td valign="top">{$smarty.const.LANG_CONTENT}</td><td><textarea name="content" cols="70" rows="10"></textarea></td></tr>
		<tr><td valign="top">{$smarty.const.LANG_ADD_CONTENT}</td><td><textarea name="add_content" cols="70" rows="15"></textarea></td></tr>
	<!--
		<tr><td>Publish time</td>
			<td>
				<select name="year">
					{foreach from=$years item=item key=key}
						<option value="{$key}">{$item}</option>
					{/foreach}
				</select>
				<select name="month">
					{foreach from=$months item=item key=key}
						<option value="{$key}">{$item}</option>
					{/foreach}
				</select>
				<select name="day">
					{foreach from=$days item=item key=key}
						<option value="{$key}">{$item}</option>
					{/foreach}
				</select>&nbsp;&nbsp;
				<input type="text" name="hour" value="00" size="2" />:<input type="text" name="minute" value="00" size="2" />:<input type="text" name="second" value="00" size="2" />
			</td>
		</tr>
	-->
		{if $can_edit_comment_setting}
		<tr><td>{$smarty.const.LANG_WHO_SEND_COMMENT}: </td><td><select name="who_comment">
													<option value="group"{if $who_comment == 'group'} selected{/if}>{$smarty.const.LANG_GROUP}</option>
													<option value="registered_user"{if $who_comment == 'registered_user'} selected{/if}>{$smarty.const.LANG_REGISTERED_USER}</option>
													<option value="every_body"{if $who_comment == 'every_body'} selected{/if}>{$smarty.const.LANG_EVERY_BODY}</option>
													<option value="no_body"{if $who_comment == 'no_body'} selected{/if}>{$smarty.const.LANG_NO_BODY}</option>
												</select></td></tr>
		<tr><td>{$smarty.const.LANG_WHO_CONFIRM_COMMENT}: </td><td><select name="who_confirm_comment">
														<option value="author"{if $who_confirm_comment == 'author'} selected{/if}>{$smarty.const.LANG_AUTHOR}</option>
														<option value="user"{if $who_confirm_comment == 'user'} selected{/if}>{$smarty.const.LANG_USER}</option>
														<option value="group"{if $who_confirm_comment == 'group'} selected{/if}>{$smarty.const.LANG_GROUP}</option>
														<option value="no_body"{if $who_confirm_comment == 'no_body'} selected{/if}>{$smarty.const.LANG_NO_BODY}</option>
													</select></td></tr>
		{/if}
	</table>
	<center>
	{if $can_confirm}<input type="submit" name="publish" value="{$smarty.const.LANG_PUBLISH_NEWS}" />{/if}
	{if $can_save}<input type="submit" name="save" value="{$smarty.const.LANG_SAVE_NEWS}" />{/if}
	</center>
	</form>
	{/if}
{else}
	<ul><li class="lb_errormenu">{$smarty.const.LANG_ADD_NEWS_PERM_ERROR}</li></ul>
{/if}
<br /><a href="{$webdir}?page={$page}">{$smarty.const.LANG_BACK}</a>

{elseif $content.item == 'edit'}
	<br />
{if $can_edit}
	{if $content.content === true}
		<ul><li>{$smarty.const.LANG_EDITED_NEWS}</li></ul>
	{elseif $content.content === false}
		<ul><li class="lb_errormenu">{$smarty.const.LANG_EDIT_NEWS_ERROR}</li></ul>
	{else}
	<form action="{$webdir}?page={$page}&news_task=edit&news_id={$content.content.id}" method="post">
	<table align="center">
		<tr><td>{$smarty.const.LANG_TITLE}</td><td><input type="text" name="title" value="{$content.content.title}" size="60" /></td></tr>
		<tr><td valign="top">{$smarty.const.LANG_CONTENT}</td><td><textarea name="content" cols="70" rows="10">{$content.content.content}</textarea></td></tr>
		<tr><td valign="top">{$smarty.const.LANG_ADD_CONTENT}</td><td><textarea name="add_content" cols="70" rows="15">{$content.content.add_content}</textarea></td></tr>
	<!--
		<tr><td>Publish time</td>
			<td>
				<select name="year">
					{foreach from=$years item=item key=key}
						<option value="{$key}">{$item}</option>
					{/foreach}
				</select>
				<select name="month">
					{foreach from=$months item=item key=key}
						<option value="{$key}">{$item}</option>
					{/foreach}
				</select>
				<select name="day">
					{foreach from=$days item=item key=key}
						<option value="{$key}">{$item}</option>
					{/foreach}
				</select>&nbsp;&nbsp;
				<input type="text" name="hour" value="00" size="2" />:<input type="text" name="minute" value="00" size="2" />:<input type="text" name="second" value="00" size="2" />
			</td>
		</tr>

		<tr><td>Who can send comment: </td><td><select name="who_comment"><option value="group">{$smarty.const.LANG_GROUP}</option><option value="registered_user">{$smarty.const.LANG_REGISTERED_USER}</option><option value="every_body">{$smarty.const.LANG_EVERY_BODY}</option><option value="no_body">{$smarty.const.LANG_NO_BODY}</option>
		<tr><td>Who can confirm comments: </td><td><select name="who_confirm_comment"><option value="author">{$smarty.const.LANG_AUTHOR}</option><option value="user">{$smarty.const.LANG_USER}</option><option value="group">{$smarty.const.LANG_GROUP}</option><option value="no_body">{$smarty.const.LANG_NO_BODY}</option></select> </td></tr>
	-->
	{if $can_edit_comment_setting}
	<tr><td>{$smarty.const.LANG_WHO_SEND_COMMENT}: </td><td><select name="who_comment">
								<option value="group"{if $content.content.who_comment == 'group'} selected{/if}>{$smarty.const.LANG_GROUP}</option>
								<option value="registered_user"{if $content.content.who_comment == 'registered_user'} selected{/if}>{$smarty.const.LANG_REGISTERED_USER}</option>
								<option value="every_body"{if $content.content.who_comment == 'every_body'} selected{/if}>{$smarty.const.LANG_EVERY_BODY}</option>
								<option value="no_body"{if $content.content.who_comment == 'no_body'} selected{/if}>{$smarty.const.LANG_NO_BODY}</option>
							</select></td></tr>
	<tr><td>{$smarty.const.LANG_WHO_CONFIRM_COMMENT}: </td><td><select name="who_confirm_comment">
									<option value="author"{if $content.content.who_confirm_comment == 'author'} selected{/if}>{$smarty.const.LANG_AUTHOR}</option>
									<option value="user"{if $content.content.who_confirm_comment == 'user'} selected{/if}>{$smarty.const.LANG_USER}</option>
									<option value="group"{if $content.content.who_confirm_comment == 'group'} selected{/if}>{$smarty.const.LANG_GROUP}</option>
									<option value="no_body"{if $content.content.who_confirm_comment == 'no_body'} selected{/if}>{$smarty.const.LANG_NO_BODY}</option>
								</select></td></tr>
	{/if}
	</table>
	<center>
	<input type="submit" name="submit" value="{$smarty.const.LANG_SUBMIT}">
	</center>
	</form>
	{/if}
{else}
	<ul><li class="lb_errormenu">{$smarty.const.LANG_EDIT_NEWS_PERM_ERROR}</li></ul>
{/if}
<br /><a href="{$webdir}?page={$page}">{$smarty.const.LANG_BACK}</a>

{elseif $content.item == 'remove'}
{if $can_edit}
	{if $content.content === true}
		<ul><li>{$smarty.const.LANG_REMOVED_NEWS}</li></ul>
	{elseif $content.content === false}
		<ul><li class="lb_errormenu">{$smarty.const.LANG_REMOVE_NEWS_ERROR}</li></ul>
	{/if}
{else}
	<ul><li class="lb_errormenu">{$smarty.const.LANG_REMOVE_NEWS_PERM_ERROR}</li></ul>
{/if}
<br /><a href="{$webdir}?page={$page}">{$smarty.const.LANG_BACK}</a>

{elseif $content.item == 'confirm'}
	{if $content.content === true}
		<ul><li>{$smarty.const.LANG_CONFIRMED_NEWS}</li></ul>
		<br /><a href="{$webdir}?page={$page}&news_task=confirm">{$smarty.const.LANG_BACK}</a>
	{elseif $content.content === false}
		<ul><li class="lb_errormenu">{$smart.const.LANG_CONFIRM_NEWS_ERROR}</li></ul>
		<br /><a href="{$webdir}?page={$page}&news_task=confirm">{$smarty.const.LANG_BACK}</a>
	{else}
		<ul>
		{if $need_confirms}
		{foreach from=$need_confirms key=id item=title}
			<li>
				<a href="{$webdir}?page={$page}&news_task=show&news_id={$id}">{$title}</a>&nbsp;&nbsp;
				[<a href="{$webdir}?page={$page}&news_task=confirm&news_id={$id}">{$smarty.const.LANG_CONFIRM_NEWS}</a>]
			</li>
		{/foreach}
		{else}
			<li>{$smarty.const.LANG_NO_NEED_CONFIRM_NEWS}</li>
		{/if}
		</ul>
		<br /><a href="{$webdir}?page={$page}">{$smarty.const.LANG_BACK}</a>
	{/if}
{elseif $content.item == 'confirm_comment'}
	{if $content.content === true}
		<ul><li>{$smarty.const.LANG_CONFIRMED_COMMENT}</li></ul>
		{if $news_id>0}<br /><a href="{$webdir}?page={$page}&news_task=show&news_id={$news_id}">{$smarty.const.LANG_BACK}</a>{/if}
	{elseif $content.content === false}
		<ul><li class="lb_errormenu">{$smarty.const.LANG_CONFIRM_COMMENT_ERROR}</li></ul>
		{if $news_id>0}<br /><a href="{$webdir}?page={$page}&news_task=show&news_id={$news_id}">{$smarty.const.LANG_BACK}</a>{/if}
	{else}
		<ul>
		{if $need_comments_confirms}
		{foreach from=$need_comments_confirms item=comment}
			<li>
				<b>{$comment.title}</b>&nbsp;&nbsp;
				[<a href="{$webdir}?page={$page}&news_task=confirm_comment&comment_id={$comment.id}">{$smarty.const.LANG_CONFIRM_COMMENT}</a>]
				{if $can_remove_comment}&nbsp;
				[<a href="{$webdir}?page={$page}&news_task=remove_comment&news_id={$news_id}&comment_id={$comment.id}">{$smarty.const.LANG_REMOVE_COMMENT}</a>]
				{/if}
				<br />
				{$comment.content}<br />
				{$smarty.const.LANG_POSTED_BY} {$comment.username} {$smarty.const.LANG_AT} {$comment.time}<br />
				<small>{$comment.user_agent}</small>
			</li>
		{/foreach}
		{else}
			<li>{$smarty.const.LANG_NO_NEED_CONFIRM_COMMENT}</li>
		{/if}
		</ul>
		{if $news_id>0}<br /><a href="{$webdir}?page={$page}&news_task=show&news_id={$news_id}">{$smarty.const.LANG_BACK}</a>{/if}
	{/if}
{elseif $content.item == 'remove_comment'}
{if $can_remove_comment}
	{if $content.content === true}
		<ul><li>{$smarty.const.LANG_REMOVED_COMMENT}</li></ul>
	{elseif $content.content === false}
		<ul><li class="lb_errormenu">{$smarty.const.LANG_REMOVE_COMMENT_ERROR}</li></ul>
	{else}
		<ul><li class="lb_errormenu">{$smarty.const.LANG_NO_REMOVE_COMMENT}</li></ul>
	{/if}
{else}
	<ul><li class="lb_errormenu">{$smarty.const.LANG_REMOVE_COMMENT_PERM_ERROR}</li></ul>
{/if}
<br />{if $news_id>0}<br /><a href="{$webdir}?page={$page}&news_task=show&news_id={$news_id}">{$smarty.const.LANG_BACK}</a>{/if}
{else}
	<div>
	{if $about_news}
		<div style="border: 1px solid rgb(199, 214, 140); padding: 5px 10px; width: 90%; margin-top: 10px;">
		{$about_news}
		</div>
	{/if}
	{if $can_send}<a href="{$webdir}?page={$page}&news_task=add">{$smarty.const.LANG_ADD_NEWS}</a><br />{/if}
	{if $need_confirm}<a href="{$webdir}?page={$page}&news_task=confirm">{$need_confirm} {$smarty.const.LANG_NEED_CONFIRM_NEWS}</a><br />{/if}
	<br />
	{foreach from=$content.content item=return}
		<div style="border: 1px solid rgb(199, 214, 140); padding: 5px 10px; width: 90%; margin-top: 10px;">
	    <b><a href="{$webdir}?page={$page}&news_task=show&news_id={$return.id}">{$return.title}</a></b>&nbsp;
	   	{if $return.can_edit}
	   		&nbsp;&nbsp;[<a href="{$webdir}?page={$page}&news_task=edit&news_id={$return.id}">{$smarty.const.LANG_EDIT_NEWS}</a>]
	   		&nbsp;&nbsp;[<a href="{$webdir}?page={$page}&news_task=remove&news_id={$return.id}">{$smarty.const.LANG_REMOVE_NEWS}</a>]
	   	{/if}
	   	<hr style="width: 100%" />
	   	{$return.content}
	   	<hr style="width: 100%" />
	   	{$smarty.const.LANG_POSTED_BY}&nbsp;{$return.user}&nbsp;{$smarty.const.LANG_AT}&nbsp;{$return.time}&nbsp;
	   	</div>
	{/foreach}
	<br /><br />
	<center>
	{section name=page start=0 loop=$news_pages_num}
	{if $smarty.section.page.index == $news_page}
		{$smarty.section.page.index+1}
	{else}
		<a href="{$webdir}?page={$page}&from={$num_of_news-$news_per_page*$smarty.section.page.index}">{$smarty.section.page.index+1}</a>
	{/if}
	&nbsp;
	{/section}
	</center>
	</div>
{/if}
